﻿using System.Windows;


namespace QuanLyDuocPham.View.QuanLyCauHinh
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class CauHinh_View : Window
    {
        public CauHinh_View()
        {
            InitializeComponent();
        }
        UIElement ui;   
        private void btnThuocTinhDuLieu_Checked(object sender, RoutedEventArgs e)
        {
            closeOtherUC("ThuocTinhDuLieu");

        }
        private void closeOtherUC(string p)
        {
            switch (p)
            {
                case "ThuocTinhDuLieu":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "DanhSachChucNang":
                    
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "TuyChinhGridView":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "TuyChinhBaoCao":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "QuanLyCanhBao":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    
                    break;
                case "DanhSachNguoiDung":
                    btnDanhSachChucNang.IsChecked = false;
                    
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "DanhSachNhomNguoiDung":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "PhanQuyenChucNang":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    btnPhanQuyenBaoCao.IsChecked = false;
                    btnThuocTinhDuLieu.IsChecked = false;
                    
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
                case "PhanQuyenBaoCao":
                    btnDanhSachChucNang.IsChecked = false;
                    btnDanhSachNguoiDung.IsChecked = false;
                    btnTuyChinhGridView.IsChecked = false;
                    btnTuyChinhBaoCao.IsChecked = false;
                    btnDanhSachNhomNguoiDung.IsChecked = false;
                    
                    btnThuocTinhDuLieu.IsChecked = false;
                    btnPhanQuyenChucNang.IsChecked = false;
                    btnQuanLyCanhBao.IsChecked = false;
                    break;
            }
        }

        private void btnDanhSachNguoiDung_Checked(object sender, RoutedEventArgs e)
        {
            closeOtherUC("DanhSachNguoiDung");

            Controllers.UC.QuanLyCauHinh.NguoiDung.UC_NGUOIDUNG_List ul = new Controllers.UC.QuanLyCauHinh.NguoiDung.UC_NGUOIDUNG_List();
            ul.Margin = new Thickness(0, 0, 0, 0);
            MainFrame.Children.Add(ul);
            ui = ul;
        }

        private void btnDanhSachNguoiDung_Unchecked(object sender, RoutedEventArgs e)
        {
            MainFrame.Children.Remove(ui);
        }

        private void btnDanhSachNhomNguoiDung_Checked(object sender, RoutedEventArgs e)
        {
            closeOtherUC("DanhSachNhomNguoiDung");

            Controllers.UC.QuanLyCauHinh.NguoiDung.UC_NHOMND_List ul = new Controllers.UC.QuanLyCauHinh.NguoiDung.UC_NHOMND_List();
            ul.Margin = new Thickness(0, 0, 0, 0);
            MainFrame.Children.Add(ul);
            ui = ul;
        }

        private void btnDanhSachNhomNguoiDung_Unchecked(object sender, RoutedEventArgs e)
        {
            MainFrame.Children.Remove(ui);
        }
        
    }
}
